#include<stdio.h>
#include <string.h>
#include <stdlib.h>
#include<math.h>

int delete_spance(char *source, char *new_str)
{
	char *from = source;
	char *to = new_str;
	int i = 0;                             //临时变量
	int j = 0;			       //临时变量
	int len = strlen(from);		       //获取字符串的长度
	while (len > 0)			       //进行循环
	{
		if (from[i] != ' ')		 //判断是否为空格
		{
			*(to + j) = from[i];	 //拷贝数据
			j++;
		}
		i++;
		len--;
	}
	*(to + j) = '\0';		          //添加结尾

	return 0;
}

int main()
{
    char data_packF[128];
    char data_pack[128] ;
    printf("请输入一个数据包：\n");
    scanf("%[^\n]", data_packF);
    
    delete_spance(data_packF, data_pack);

    printf("新数据包为：%s",data_pack);

    return 0;
}